package net.kucoe.grin.internal.script;

import java.util.List;

import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public class InfoTest {
    
    public static void main(final String[] args) {
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngineFactory factory = manager.getEngineByName("js").getFactory();
        System.out.println("JS engine metadata");
        System.out.println("Engine name: " + factory.getEngineName());
        System.out.println("Engine version: " + factory.getEngineVersion());
        System.out.println("Language name: " + factory.getLanguageName());
        System.out.println("Language version: " + factory.getLanguageVersion());
        List<String> extensions = factory.getExtensions();
        System.out.print("Language extensions: ");
        for (String extension : extensions) {
            System.out.print(extension + " ");
        }
        System.out.println();
        System.out.print("Language mime types: ");
        List<String> mimeTypes = factory.getMimeTypes();
        for (String mimeType : mimeTypes) {
            System.out.print(mimeType + " ");
        }
        System.out.println();
        List<String> names = factory.getNames();
        System.out.print("Engine names: ");
        for (String name : names) {
            System.out.print(name + " ");
        }
        System.out.println();
    }
}
